/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package adp1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 *
 * Permutation utility class
 */
public final class Permutations {

    private Permutations() {
    }

    public static Permutation createPermutation(List<Integer> image) {
        return PermutationImageList.valueOf(image);
    }

    public static Permutation createPermutation(Collection<List<Integer>> cycles) {
        return PermutationImageList.valueOf(cycles);
    }

    public static Permutation createPermutation(Collection<List<Integer>> cycles, int size) {
        return PermutationImageList.valueOf(cycles, size);
    }

    public static Permutation idPerm(int n) {
        List<Integer> image = new ArrayList<Integer>();
        for (int i = 1; i <= n; i++) {
            image.add(i);
        }
        return createPermutation(image);
    }
}
